from django.db import models


# Create your models here.
class UserModel(models.Model):
    username = models.CharField(max_length=30, unique=True)
    email = models.CharField(max_length=30,unique=True)
    password = models.CharField(max_length=30)
    def __str__(self):
        return self.username
    class Meta:
        db_table = 'user'


class PostModel(models.Model):
    title = models.CharField(max_length=30)
    content = models.CharField(max_length=30)
    user = models.ForeignKey(UserModel,on_delete=models.CASCADE)
    def __str__(self):
        return self.title
    class Meta:
        db_table = 'post'